package com.lmaos.basetools.queue3;

import java.util.concurrent.ThreadPoolExecutor;

import com.lmaos.basetools.proxy.GetBean;
/** 异步队列,将被 @Async 注解修饰的方法作为异步方法
 *  
 */
public interface AsyncQueue3 extends GetBean{
	/** 设置线程池,异步队列通过当前指定的线程池运行
	 * 
	 * @param threadPoolExecutor
	 * @return
	 */
	ThreadPoolExecutor setThreadPoolExecutor(ThreadPoolExecutor threadPoolExecutor);
	
	ThreadPoolExecutor getThreadPoolExecutor();
	/**
	 *  设置异步结果回调
	 * @param asyncResultCallback
	 */
	void setAsyncResultCallback(AsyncResultCallback asyncResultCallback);
	
	AsyncResultCallback getAsyncResultCallback();
	/** 添加异步结果回调
	 * 
	 * @param className
	 * @param asyncResultCallback
	 */
	void addAsyncResultCallback(String className,AsyncResultCallback asyncResultCallback);
	/** 添加异步结果回调
	 * 
	 * @param className
	 * @param asyncResultCallback
	 */
	void addAsyncResultCallback(Class clazz,AsyncResultCallback asyncResultCallback);
	
	AsyncResultCallback getAsyncResultCallback(String className);
	
	AsyncResultCallback getAsyncResultCallback(Class clazz);
	
	void close();
	
}
